<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- 
      v-if:当我们条件为false时,包含v-if指令的元素,根本就不会存在我们的dom中
      v-show:当条件为false时,v-show只是给我们的元素添加一个行内样式,display:none
     -->
    <h2 v-if="isShow" id="aaa">{{message}}</h2>
    <h2 v-show="isShow" id="bbb">{{message}}</h2>
    <span v-show="isShow" id="ccc">{{message}}</span>
  </div>

  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        message: 'hello',
        isShow: true
      },
      methods: {}
    });
  </script>
</body>

</html>